﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="DTGroup_ZheJiang.WebUI.Login" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta charset="utf-8" />
    <title>三位一体精确定位系统</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="" />
    <meta name="author" content="" />
    <link rel="stylesheet" href="assets/css/reset.css" />
    <link rel="stylesheet" href="assets/css/supersized.css" />
    <link rel="stylesheet" href="assets/css/style.css" />
    <script src="js/jquery-1.6.4.min.js" type="text/javascript"></script>
    <script src="js/AlertBox.js" type="text/javascript"></script>
    <script src="js/LightBox.js" type="text/javascript"></script>

    <script type="text/javascript">
        $(function () {
            $('#btnLogin').bind('click', Login);
        });
        var boxcallback = function (callbackParameter) { };
        var Login = function () {
            var user = jQuery.trim($('#username').val());
            var pwd = jQuery.trim($('#password').val());
            if (user.length == 0 || pwd.length == 0) {
                alertBox(boxcallback, "0", "提示", "请填写用户名和密码");
                return false;
            } else {
                $.ajax({
                    type: "POST",
                    contentType: "application/x-www-form-urlencoded",
                    data: { Options: "UserLogin", userName: user, userPwd: pwd },
                    url: "/Login.aspx",
                    success: function (data) {
                        if (data == "0") {
                            alertBox(boxcallback, "0", "提示", "账户名或密码错误")
                            return false;
                        } else {
                            //alertBox(boxcallback, "0", "提示", data)
                            location.href = "/List/BuildingsStatisticsReport.aspx#Menu=0";
                        }
                    },
                    error: function (exh, e) {
                        alertBox(boxcallback, "0", "提示", "系统出错请稍后再试")
                        return false;
                    }
                });
            }
        }
    </script>
</head>
<body>
    <div class="page-container">
        <h1>
            Login</h1>
        <form action="" method="post">
        <input type="text" name="username" id="username" class="username" placeholder="Username" />
        <input type="password" name="password" id="password" class="password" placeholder="Password" />
        <button type="button" id="btnLogin">
            登录</button>
        </form>
    </div>
    <script src="assets/js/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="assets/js/supersized.3.2.7.min.js" type="text/javascript"></script>
    <script src="assets/js/supersized-init.js" type="text/javascript"></script>
    <script src="assets/js/scripts.js" type="text/javascript"></script>
</body>
</html>
